# encoding = utf-8
class CreateCarts < ActiveRecord::Migration
  def self.up
    create_table :carts do |t|
      t.integer :user_id
      t.integer :product_id
      t.integer :number, :default => 1

      t.timestamps
    end
    
    add_index :carts, :user_id,                :unique => false
    add_index :carts, :product_id,                :unique => false
  end

  def self.down
    drop_table :carts
  end
end
